﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'ConstraintKey_Insert')
	BEGIN
		DROP  Procedure  ConstraintKey_Insert
	END

GO

CREATE Procedure ConstraintKey_Insert

	(
		@conId uniqueidentifier,
		@priId uniqueidentifier,
		@forId uniqueidentifier
	)


AS
begin

	declare @id uniqueidentifier;
	set @id=newid();
	Insert Into [Constraint_Keys]
		(CONS_KEY_ID,CONS_ID,CONS_KEY_PRIMARY,CONS_KEY_FOREIGN) values (@newid,@conId,@priId,@forId);
		
	select @newid;

end

GO

/*
GRANT EXEC ON Stored_Procedure_Name TO PUBLIC

GO
*/

